<script src="jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
  $(document).ready(function(){


      var val = $('.success').text();
      alert(val)

  });
</script>

<div class="success">
This is success message 1234.
This is success message 1234.
This is success message 1234.
This is success message 1234.
</div>
